package com.zhangxu.microservice.auth.vo.req;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;

/**
 * 创建角色请求
 */
@Data
@Schema(description = "创建角色请求")
public class CreateRoleReq {

    @Schema(description = "角色名称", example = "管理员")
    @NotBlank(message = "角色名称不能为空")
    @Size(max = 50, message = "角色名称长度不能超过50个字符")
    private String name;

    @Schema(description = "角色编码", example = "ADMIN")
    @NotBlank(message = "角色编码不能为空")
    @Pattern(regexp = "^[A-Z_]+$", message = "角色编码只能包含大写字母和下划线")
    @Size(max = 50, message = "角色编码长度不能超过50个字符")
    private String code;

    @Schema(description = "角色描述", example = "系统管理员角色")
    @Size(max = 255, message = "角色描述长度不能超过255个字符")
    private String description;
}